<?php
/*==========================================================================*\
| AGRIVIET - CONTENT MANAGERMENT SYSTEM						
\*==========================================================================*/

//	error_reporting(E_ALL);
	error_reporting(0);
	if (isset($_POST["PHPSESSID"])) {
		session_id($_POST["PHPSESSID"]);
	}
	session_start();

	  
	//echo $_SESSION["xxx"]."@@@@@@@@@@@";
	
	
	if(!isset($_SESSION["session_message"])){
	//session_register("session_message");
	$_SESSION["session_message"] = "";
	}
	if(isset($_GET['page']))
	$page = $_GET['page'];
	if ($_REQUEST['act']=='logout') session_unregister('admin');
	require_once("../config/database.php");
	require_once("../inc/class.db.php");
	require_once("../inc/class.paging.php");
	
	$db = new DB($namedb, $serverdb, $userdb, $passdb);
	
	require_once("../inc/file_functions.php");
	require_once("../inc/resize_image.php");
	require_once("../inc/functions.php");
	require_once("../inc/products_func.php");
	require_once("../inc/password_funcs.php");
	require_once("../inc/create_html.php");
	
	
	
	
	
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><?=$webname;?> :: Control Panel</title>
<link href="../favicon.gif" rel="shortcut icon">

<style type="text/css">
<!--
.style1 {color: #0000FF}
-->
</style>
</head><body>


<?
if (!session_is_registered('admin'))
{

echo '<LINK href="style.css" rel="stylesheet" type="text/css">';
require_once("admin_login.php");
}else{

######################################################################## XOA LINK IMG
	
if ($_GET['delete_img']<>0)
	{	
	
		if ($_GET['do']<>'OK') 
		{
		echo "<a href='./index.php?do=OK&delete_img={$_GET['delete_img']}'>DELETE IMG</a>";
		exit;
		}
		
		$sqlx = "DELETE FROM `linkimg` WHERE `news_id` = {$_GET['delete_img']}";
		if (mysql_query($sqlx)) 
	echo "<font color='".mt_rand(0xFF0000 , 0x0000FF )."'>XONG !</font> <a href='./index.php?do=OK&delete_img={$_GET['delete_img']}'>DELETE IMG</a>";
	exit;
	}
	
	//###################################################################
	
	
	
?>

<LINK href="style.css" rel="stylesheet" type="text/css">
<div id="top"><h1>PKT-CVCX Administrator</h1></div>
<table border="0" width="100%" cellspacing="0" cellpadding="0" id="table1">
<tr>
<td width="16%" valign="top">
<? include("panel_left.php"); ?>
</td>
<td valign="top">
<table border="0" cellpadding="0" style=" margin-right:5px" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<td width="10">&nbsp;</td>
<td>
<?	
$module = array(
    'news_cat'   	=> 'news_categories.php',
	'news_cat_m'   	=> 'news_categories_m.php',
	
	'bql_m'   	=> 'bql_m.php',
	'bql'   	=> 'bql.php',
	
	'cv_m'   	=> 'cv_m.php',
	'cv'   	=> 'cv.php',
	
	'user'   	=> 'user.php',
	'cv'   	=> 'cv.php',
	
	
	
	'news_cat_m'   	=> 'news_categories_m.php',
	
	'cat'   	=> 'admin_categories.php',
	
    'cat_m'   	=> 'admin_categories_m.php',
	
	
	
	'content'   => 'admin_content.php',
    'content_m' => 'admin_content_m.php',   
	'news'   	=> 'news.php',
	'news_m' 	=> 'news_m.php',		
	'backup'    => 'admin_backup.php',	
	'servinfo'  => 'admin_servinfo.php',
	
	'admin'  	=> 'admin_administators.php',	
	
	'download_cat'  => 'download_categories.php',
	'download_cat_m'  => 'download_categories_m.php',
	'download'  => 'download.php',
	'download_m'=> 'download_m.php',	
	
	'product_cat'  => 'product_categories.php',
	'product_cat_m'  => 'product_categories_m.php',
	
	'product'   => 'product.php',
	'product_m'   => 'product_m.php',
	'comment'   => 'admin_comment.php',
	'comment_m'   => 'admin_comment_m.php',
	'sendmail'   => 'admin_sendmail.php',
	'mail'   => 'admin_mail.php',
	
);
$Match=0;
$act=$_REQUEST['act'];
foreach ($module as $key => $val) {
	if ( strcasecmp( $act, $key ) == 0 ) {
			$Match = 1;
			//echo $v;
			include($val); 
	}
}	
	?>
<script language="JavaScript">
function chkallClick(o) {
  	var form = document.frmList;
	for (var i = 0; i < form.elements.length; i++) {
		if (form.elements[i].type == "checkbox" && form.elements[i].name!="chkall") {
			form.elements[i].checked = document.frmList.chkall.checked;
		}
	}
}
</script></td></tr></table>
</td>
</tr>
</table>
<? }
	//$db->resetFetch($result);
	// Close the connexion to the base:
	$db->close();



?>
<div id="bottom">
  <p>- Mỗi công văn chỉ nhập một lần duy nhất, nếu có sai sót thì click vào tên công văn để chỉnh sửa nội dung.<br />
  - Kiểm tra lại nội dung công văn sau khi nhập liệu, viết tắt hệ thống sẽ không tìm kiếm được. </p>
</div>
</body>
</html>